<?php if (!defined('THINK_PATH')) exit(); /*a:4:{s:83:"E:\web\project\baojia\wwwww\public/../application/admin\view\bankuai\gongjishu.html";i:1534253535;s:70:"E:\web\project\baojia\wwwww\application\admin\view\layout\default.html";i:1529292885;s:67:"E:\web\project\baojia\wwwww\application\admin\view\common\meta.html";i:1535883685;s:69:"E:\web\project\baojia\wwwww\application\admin\view\common\script.html";i:1533222223;}*/ ?>
<!DOCTYPE html>
<html lang="<?php echo $config['language']; ?>">
    <head>
        <meta charset="utf-8">
<title><?php echo (isset($title) && ($title !== '')?$title:''); ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta name="renderer" content="webkit">

<link rel="shortcut icon" href="/public/assets/img/favicon.ico" />
<!-- Loading Bootstrap -->
<link href="/public/assets/css/backend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.css?v=<?php echo \think\Config::get('site.version'); ?>" rel="stylesheet">
<link href="/public/assets/js/uploadify/uploadify.css" rel="stylesheet">

<!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
<!--[if lt IE 9]>
  <script src="/public/assets/js/html5shiv.js"></script>
  <script src="/public/assets/js/respond.min.js"></script>
<![endif]-->
<script type="text/javascript">
    var require = {
        config:  <?php echo json_encode($config); ?>
    };
</script>
<script src="/public/assets/libs/jquery/dist/jquery.min.js"></script>
<script src="/public/assets/js/uploadify/jquery.uploadify.min.js"></script>
    </head>

    <body class="inside-header inside-aside <?php echo defined('IS_DIALOG') && IS_DIALOG ? 'is-dialog' : ''; ?>">
        <div id="main" role="main">
            <div class="tab-content tab-addtabs">
                <div id="content">
                    <div class="row">
                        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                            <section class="content-header hide">
                                <h1>
                                    <?php echo __('Dashboard'); ?>
                                    <small><?php echo __('Control panel'); ?></small>
                                </h1>
                            </section>
                            <?php if(!IS_DIALOG && !$config['fastadmin']['multiplenav']): ?>
                            <!-- RIBBON -->
                            <div id="ribbon">
                                <ol class="breadcrumb pull-left">
                                    <li><a href="dashboard" class="addtabsit"><i class="fa fa-dashboard"></i> <?php echo __('Dashboard'); ?></a></li>
                                </ol>
                                <ol class="breadcrumb pull-right">
                                    <?php foreach($breadcrumb as $vo): ?>
                                    <li><a href="javascript:;" data-url="<?php echo $vo['url']; ?>"><?php echo $vo['title']; ?></a></li>
                                    <?php endforeach; ?>
                                </ol>
                            </div>
                            <!-- END RIBBON -->
                            <?php endif; ?>
                            <div class="content">
                                <div class="panel panel-default panel-intro">
    <div class="panel-heading">
        <?php echo build_heading(null, false); ?>
        <ul class="nav nav-tabs">
            <?php if(is_array($app_type) || $app_type instanceof \think\Collection || $app_type instanceof \think\Paginator): $i = 0; $__LIST__ = $app_type;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
              <li <?php if($key == 0): ?> class="active" <?php endif; ?>><a href="#type_<?php echo $vo['id']; ?>" data-toggle="tab"><?php echo $vo['name']; ?></a></li>
            <?php endforeach; endif; else: echo "" ;endif; ?>
        </ul>
    </div>
    <div class="panel-body">
        <div id="myTabContent" class="tab-content">
            <?php if(is_array($app_type) || $app_type instanceof \think\Collection || $app_type instanceof \think\Paginator): $i = 0; $__LIST__ = $app_type;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
             <div class="tab-pane fade <?php if($key == 0): ?> active in <?php endif; ?>" id="type_<?php echo $vo['id']; ?>" data-id="<?php echo $vo['id']; ?>">
                <form id="type_<?php echo $vo['id']; ?>_form" class="form-horizontal" method="POST" action="">
                    <div class="bootstrap-table">
                        <div class="fixed-table-container" style="padding-bottom: 0px;">
                            <div class="fixed-table-body">
                                <table id="type_<?php echo $vo['id']; ?>_table" class="table table-striped table-bordered table-hover" width="100%">
                                    <thead>
                                        <tr>
                                            <th style="text-align: center; vertical-align: middle; ">
                                                <div class="th-inner ">类目</div>
                                            </th>
                                            <th style="text-align: center; vertical-align: middle; ">
                                                <div class="th-inner ">技术选型及工期</div>
                                            </th>
                                        </tr>
                                        <tr>
                                            <th style="text-align: center; vertical-align: middle; ">
                                                <div class="th-inner ">后端技术</div>
                                            </th>
                                            <td>
                                                <div class="bootstrap-table">
                                                    <div class="fixed-table-container" style="padding-bottom: 0px;">
                                                        <div class="fixed-table-body">
                                                            <table  class="table table-striped table-bordered table-hover" width="100%">
                                                                <thead>
                                                                <tr>
                                                                    <th style="text-align: center; vertical-align: middle; ">
                                                                        <div class="th-inner ">功能名称</div>
                                                                    </th>
                                                                    <th style="text-align: center; vertical-align: middle; ">
                                                                        <div class="th-inner ">功能类型</div>
                                                                    </th>
                                                                    <th style="text-align: center; vertical-align: middle; ">
                                                                        <div class="th-inner ">技术选型</div>
                                                                    </th>
                                                                </tr>
                                                                <tr>
                                                                    <td style="text-align: center; vertical-align: middle;">
                                                                        <?php 
                                                                          $gong=db('gongnen')->where('id',$gongnen['gid'])->find();
                                                                           echo $gong['name'];
                                                                          ?>
                                                                    </td>
                                                                    <td style="text-align: center; vertical-align: middle;">
                                                                        <select class="form-control" name="budget_id">
                                                                            <?php if(is_array($budget_manage) || $budget_manage instanceof \think\Collection || $budget_manage instanceof \think\Paginator): $i = 0; $__LIST__ = $budget_manage;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$bu): $mod = ($i % 2 );++$i;?>
                                                                             <option value="<?php echo $bu['id']; ?>" <?php if((!empty($vo['list'])) AND $bu['id'] == $vo['list']['budget_id']): ?>selected<?php endif; ?>><?php echo $bu['name']; ?></option>
                                                                            <?php endforeach; endif; else: echo "" ;endif; ?>
                                                                        </select>
                                                                    </td>
                                                                    <td style="text-align: center; vertical-align: middle;">

                                                                        <div class="bootstrap-table">
                                                                            <div class="fixed-table-container" style="padding-bottom: 0px;">
                                                                                <div class="fixed-table-body">
                                                                                    <table class="insert-tr table table-striped table-bordered table-hover onclick" width="100%">
                                                                                        <thead>
                                                                                        <tr>
                                                                                            <th style="text-align: center; vertical-align: middle; ">
                                                                                                <div class="th-inner ">应用语言</div>
                                                                                            </th>
                                                                                            <th style="text-align: center; vertical-align: middle; ">
                                                                                                <div class="th-inner ">工期（小时）</div>
                                                                                            </th>
                                                                                        </tr>
																					   <?php if(!(empty($vo['list']['technology']) || (($vo['list']['technology'] instanceof \think\Collection || $vo['list']['technology'] instanceof \think\Paginator ) && $vo['list']['technology']->isEmpty()))): if(is_array($vo['list']['technology']) || $vo['list']['technology'] instanceof \think\Collection || $vo['list']['technology'] instanceof \think\Paginator): $i = 0; $__LIST__ = $vo['list']['technology'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$item): $mod = ($i % 2 );++$i;?>
                                                                                           <tr class="technology_language">
                                                                                             <td style="text-align: center; vertical-align: middle;">
                                                                                                <select class="form-control" name="tid" >
                                                                                                    <?php if(is_array($technology_language) || $technology_language instanceof \think\Collection || $technology_language instanceof \think\Paginator): $i = 0; $__LIST__ = $technology_language;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$th): $mod = ($i % 2 );++$i;?>
                                                                                                      <option value="<?php echo $th['id']; ?>" <?php if($th['id'] == $item[0]): ?>selected<?php endif; ?>><?php echo $th['name']; ?></option>
                                                                                                    <?php endforeach; endif; else: echo "" ;endif; ?>
                                                                                                </select>
                                                                                            </td>
                                                                                            <td class="copy" style="text-align: center; vertical-align: middle;">
                                                                                                <div class="col-xs-12 col-sm-8">
                                                                                                    <input class="form-control" type="number" name="time" value="<?php echo $item[1]; ?>">
                                                                                                </div>
                                                                                                <div class="col-xs-12 col-sm-3">
                                                                                                    <a href="javascript:;" class="btn my-btn-add btn-success"><i class="fa fa-plus"></i></a>
                                                                                                    <a href="javascript:;" class="btn my-btn-del btn-danger"><i class="fa fa-trash"></i></a>
                                                                                                </div>
                                                                                            </td>
                                                                                         </tr>
																						<?php endforeach; endif; else: echo "" ;endif; else: ?>
																						  <tr class="technology_language">
                                                                                             <td style="text-align: center; vertical-align: middle;">
                                                                                                <select class="form-control" name="tid" >
                                                                                                    <?php if(is_array($technology_language) || $technology_language instanceof \think\Collection || $technology_language instanceof \think\Paginator): $i = 0; $__LIST__ = $technology_language;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$th): $mod = ($i % 2 );++$i;?>
                                                                                                      <option value="<?php echo $th['id']; ?>"><?php echo $th['name']; ?></option>
                                                                                                    <?php endforeach; endif; else: echo "" ;endif; ?>
                                                                                                </select>
                                                                                            </td>
                                                                                            <td class="copy" style="text-align: center; vertical-align: middle;">
                                                                                                <div class="col-xs-12 col-sm-8">
                                                                                                    <input class="form-control" type="number" name="time">
                                                                                                </div>
                                                                                                <div class="col-xs-12 col-sm-3">
                                                                                                    <a href="javascript:;" class="btn my-btn-add btn-success"><i class="fa fa-plus"></i></a>
                                                                                                    <a href="javascript:;" class="btn my-btn-del btn-danger"><i class="fa fa-trash"></i></a>
                                                                                                </div>
                                                                                            </td>
                                                                                         </tr>
																					   <?php endif; ?>	
                                                                                        </thead>
                                                                                    </table>
                                                                                </div>
                                                                            </div>
                                                                        </div>

                                                                    </td>
                                                                </tr>
                                                                </thead>
                                                            </table>
                                                        </div>
                                                    </div>
                                                </div>
                                            </td>
                                        </tr>
                                    </thead>
                                </table>
                                <div style="text-align:center;margin-top: 15px;">                                
                                    <span class="btn btn-success" id="submit">保存</span>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
             </div>
            <?php endforeach; endif; else: echo "" ;endif; ?>

        </div>
    </div>
</div>

<script>
    $(function(){
        $("#submit").click(function(){
            var items = new Array();
            var cheklist=$(".active.in").find(".technology_language");
            for (var i = 0; i < cheklist.length; i++) {
                var child_box=$(cheklist[i]);
                var tid=child_box.find("[name=tid]").val();
                var time=child_box.find("input[name=time]").val();
                var item=[tid,time];
                items.push(item);
            }
            var technology=JSON.stringify( items );

			var type_id=$(".active.in").attr('data-id');
            var gid="<?php echo $gongnen['id']; ?>";
            var tech_type=1;
            var budget_id=$(".active.in").find("input[name=budget_id]").val();
            $.ajax({
                type:'POST',
                data:{
				    type_id:type_id,
                    gid:gid,
                    tech_type:tech_type,
                    budget_id:budget_id,
                    technology:technology,
                },
                url:"<?php echo url('gongjsave'); ?>",
                traditional: true,
                success:function(data){
                    if(data.code==1){
                        alert(data.msg);
                        window.location.href=data.url;
                    }else{
                        alert(data.msg);
                    }
                }
            });
            return false;
        });

    })
</script>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
<script src="/public/assets/js/require<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.js" data-main="/public/assets/js/require-backend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.js?v=<?php echo $site['version']; ?>"></script>
    </body>
</html>